package day017.homework.p2;

import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入1~7之间的整数值：");
        int num = sc.nextInt();

        String week = "";
        try {
            week = getWeek(num);
        } catch (Exception e) {
            String msg = e.getMessage();
            System.out.println(msg);
        }

        System.out.println(week);
    }

    public static String getWeek(int num) throws RuntimeException {
        if (num < 1 || num > 7) {
            throw new RuntimeException("输入错误！");
        }

        String[] arr = {"星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"};

        return arr[num - 1];
    }
}
